3.206 \(\int \tan ^2(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=69 \[ \frac {b (2 a-b) \tan ^3(e+f x)}{3 f}+\frac {(a-b)^2 \tan (e+f x)}{f}-x (a-b)^2+\frac {b^2 \tan ^5(e+f x)}{5 f} \]

[Out]

-(a-b)^2*x+(a-b)^2*tan(f*x+e)/f+1/3*(2*a-b)*b*tan(f*x+e)^3/f+1/5*b^2*tan(f*x+e)^5/f

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3670, 461, 203} \[ \frac {b (2 a-b) \tan ^3(e+f x)}{3 f}+\frac {(a-b)^2 \tan (e+f x)}{f}-x (a-b)^2+\frac {b^2 \tan ^5(e+f x)}{5 f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^2*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-((a - b)^2*x) + ((a - b)^2*Tan[e + f*x])/f + ((2*a - b)*b*Tan[e + f*x]^3)/(3*f) + (b^2*Tan[e + f*x]^5)/(5*f)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 461

Int[(((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_))/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Int[ExpandIntegr
and[((e*x)^m*(a + b*x^n)^p)/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n
, 0] && IGtQ[p, 0] && (IntegerQ[m] || IGtQ[2*(m + 1), 0] ||  !RationalQ[m])

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \tan ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2 \left (a+b x^2\right )^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \left ((a-b)^2+(2 a-b) b x^2+b^2 x^4+\frac {-a^2+2 a b-b^2}{1+x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a-b)^2 \tan (e+f x)}{f}+\frac {(2 a-b) b \tan ^3(e+f x)}{3 f}+\frac {b^2 \tan ^5(e+f x)}{5 f}-\frac {(a-b)^2 \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-(a-b)^2 x+\frac {(a-b)^2 \tan (e+f x)}{f}+\frac {(2 a-b) b \tan ^3(e+f x)}{3 f}+\frac {b^2 \tan ^5(e+f x)}{5 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.05, size = 137, normalized size = 1.99 \[ -\frac {a^2 \tan ^{-1}(\tan (e+f x))}{f}+\frac {a^2 \tan (e+f x)}{f}+\frac {2 a b \tan ^{-1}(\tan (e+f x))}{f}+\frac {2 a b \tan ^3(e+f x)}{3 f}-\frac {2 a b \tan (e+f x)}{f}-\frac {b^2 \tan ^{-1}(\tan (e+f x))}{f}+\frac {b^2 \tan ^5(e+f x)}{5 f}-\frac {b^2 \tan ^3(e+f x)}{3 f}+\frac {b^2 \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^2*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-((a^2*ArcTan[Tan[e + f*x]])/f) + (2*a*b*ArcTan[Tan[e + f*x]])/f - (b^2*ArcTan[Tan[e + f*x]])/f + (a^2*Tan[e +
 f*x])/f - (2*a*b*Tan[e + f*x])/f + (b^2*Tan[e + f*x])/f + (2*a*b*Tan[e + f*x]^3)/(3*f) - (b^2*Tan[e + f*x]^3)
/(3*f) + (b^2*Tan[e + f*x]^5)/(5*f)

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 73, normalized size = 1.06 \[ \frac {3 \, b^{2} \tan \left (f x + e\right )^{5} + 5 \, {\left (2 \, a b - b^{2}\right )} \tan \left (f x + e\right )^{3} - 15 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} f x + 15 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )}{15 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/15*(3*b^2*tan(f*x + e)^5 + 5*(2*a*b - b^2)*tan(f*x + e)^3 - 15*(a^2 - 2*a*b + b^2)*f*x + 15*(a^2 - 2*a*b + b
^2)*tan(f*x + e))/f

________________________________________________________________________________________

giac [B]  time = 8.87, size = 937, normalized size = 13.58 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

-1/15*(15*a^2*f*x*tan(f*x)^5*tan(e)^5 - 30*a*b*f*x*tan(f*x)^5*tan(e)^5 + 15*b^2*f*x*tan(f*x)^5*tan(e)^5 - 75*a
^2*f*x*tan(f*x)^4*tan(e)^4 + 150*a*b*f*x*tan(f*x)^4*tan(e)^4 - 75*b^2*f*x*tan(f*x)^4*tan(e)^4 + 15*a^2*tan(f*x
)^5*tan(e)^4 - 30*a*b*tan(f*x)^5*tan(e)^4 + 15*b^2*tan(f*x)^5*tan(e)^4 + 15*a^2*tan(f*x)^4*tan(e)^5 - 30*a*b*t
an(f*x)^4*tan(e)^5 + 15*b^2*tan(f*x)^4*tan(e)^5 + 150*a^2*f*x*tan(f*x)^3*tan(e)^3 - 300*a*b*f*x*tan(f*x)^3*tan
(e)^3 + 150*b^2*f*x*tan(f*x)^3*tan(e)^3 + 10*a*b*tan(f*x)^5*tan(e)^2 - 5*b^2*tan(f*x)^5*tan(e)^2 - 60*a^2*tan(
f*x)^4*tan(e)^3 + 150*a*b*tan(f*x)^4*tan(e)^3 - 75*b^2*tan(f*x)^4*tan(e)^3 - 60*a^2*tan(f*x)^3*tan(e)^4 + 150*
a*b*tan(f*x)^3*tan(e)^4 - 75*b^2*tan(f*x)^3*tan(e)^4 + 10*a*b*tan(f*x)^2*tan(e)^5 - 5*b^2*tan(f*x)^2*tan(e)^5
- 150*a^2*f*x*tan(f*x)^2*tan(e)^2 + 300*a*b*f*x*tan(f*x)^2*tan(e)^2 - 150*b^2*f*x*tan(f*x)^2*tan(e)^2 + 3*b^2*
tan(f*x)^5 - 20*a*b*tan(f*x)^4*tan(e) + 25*b^2*tan(f*x)^4*tan(e) + 90*a^2*tan(f*x)^3*tan(e)^2 - 240*a*b*tan(f*
x)^3*tan(e)^2 + 150*b^2*tan(f*x)^3*tan(e)^2 + 90*a^2*tan(f*x)^2*tan(e)^3 - 240*a*b*tan(f*x)^2*tan(e)^3 + 150*b
^2*tan(f*x)^2*tan(e)^3 - 20*a*b*tan(f*x)*tan(e)^4 + 25*b^2*tan(f*x)*tan(e)^4 + 3*b^2*tan(e)^5 + 75*a^2*f*x*tan
(f*x)*tan(e) - 150*a*b*f*x*tan(f*x)*tan(e) + 75*b^2*f*x*tan(f*x)*tan(e) + 10*a*b*tan(f*x)^3 - 5*b^2*tan(f*x)^3
 - 60*a^2*tan(f*x)^2*tan(e) + 150*a*b*tan(f*x)^2*tan(e) - 75*b^2*tan(f*x)^2*tan(e) - 60*a^2*tan(f*x)*tan(e)^2
+ 150*a*b*tan(f*x)*tan(e)^2 - 75*b^2*tan(f*x)*tan(e)^2 + 10*a*b*tan(e)^3 - 5*b^2*tan(e)^3 - 15*a^2*f*x + 30*a*
b*f*x - 15*b^2*f*x + 15*a^2*tan(f*x) - 30*a*b*tan(f*x) + 15*b^2*tan(f*x) + 15*a^2*tan(e) - 30*a*b*tan(e) + 15*
b^2*tan(e))/(f*tan(f*x)^5*tan(e)^5 - 5*f*tan(f*x)^4*tan(e)^4 + 10*f*tan(f*x)^3*tan(e)^3 - 10*f*tan(f*x)^2*tan(
e)^2 + 5*f*tan(f*x)*tan(e) - f)

________________________________________________________________________________________

maple [B]  time = 0.03, size = 132, normalized size = 1.91 \[ \frac {b^{2} \left (\tan ^{5}\left (f x +e \right )\right )}{5 f}+\frac {2 \left (\tan ^{3}\left (f x +e \right )\right ) a b}{3 f}-\frac {b^{2} \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {a^{2} \tan \left (f x +e \right )}{f}-\frac {2 a b \tan \left (f x +e \right )}{f}+\frac {b^{2} \tan \left (f x +e \right )}{f}-\frac {\arctan \left (\tan \left (f x +e \right )\right ) a^{2}}{f}+\frac {2 \arctan \left (\tan \left (f x +e \right )\right ) a b}{f}-\frac {\arctan \left (\tan \left (f x +e \right )\right ) b^{2}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/5*b^2*tan(f*x+e)^5/f+2/3/f*tan(f*x+e)^3*a*b-1/3*b^2*tan(f*x+e)^3/f+1/f*a^2*tan(f*x+e)-2*a*b*tan(f*x+e)/f+b^2
*tan(f*x+e)/f-1/f*arctan(tan(f*x+e))*a^2+2/f*arctan(tan(f*x+e))*a*b-1/f*arctan(tan(f*x+e))*b^2

________________________________________________________________________________________

maxima [A]  time = 1.04, size = 76, normalized size = 1.10 \[ \frac {3 \, b^{2} \tan \left (f x + e\right )^{5} + 5 \, {\left (2 \, a b - b^{2}\right )} \tan \left (f x + e\right )^{3} - 15 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} {\left (f x + e\right )} + 15 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )}{15 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/15*(3*b^2*tan(f*x + e)^5 + 5*(2*a*b - b^2)*tan(f*x + e)^3 - 15*(a^2 - 2*a*b + b^2)*(f*x + e) + 15*(a^2 - 2*a
*b + b^2)*tan(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 11.67, size = 100, normalized size = 1.45 \[ \frac {{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {2\,a\,b}{3}-\frac {b^2}{3}\right )}{f}-\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,{\left (a-b\right )}^2}{a^2-2\,a\,b+b^2}\right )\,{\left (a-b\right )}^2}{f}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a^2-2\,a\,b+b^2\right )}{f}+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^5}{5\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)^2*(a + b*tan(e + f*x)^2)^2,x)

[Out]

(tan(e + f*x)^3*((2*a*b)/3 - b^2/3))/f - (atan((tan(e + f*x)*(a - b)^2)/(a^2 - 2*a*b + b^2))*(a - b)^2)/f + (t
an(e + f*x)*(a^2 - 2*a*b + b^2))/f + (b^2*tan(e + f*x)^5)/(5*f)

________________________________________________________________________________________

sympy [A]  time = 0.63, size = 117, normalized size = 1.70 \[ \begin {cases} - a^{2} x + \frac {a^{2} \tan {\left (e + f x \right )}}{f} + 2 a b x + \frac {2 a b \tan ^{3}{\left (e + f x \right )}}{3 f} - \frac {2 a b \tan {\left (e + f x \right )}}{f} - b^{2} x + \frac {b^{2} \tan ^{5}{\left (e + f x \right )}}{5 f} - \frac {b^{2} \tan ^{3}{\left (e + f x \right )}}{3 f} + \frac {b^{2} \tan {\left (e + f x \right )}}{f} & \text {for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\relax (e )}\right )^{2} \tan ^{2}{\relax (e )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**2*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Piecewise((-a**2*x + a**2*tan(e + f*x)/f + 2*a*b*x + 2*a*b*tan(e + f*x)**3/(3*f) - 2*a*b*tan(e + f*x)/f - b**2
*x + b**2*tan(e + f*x)**5/(5*f) - b**2*tan(e + f*x)**3/(3*f) + b**2*tan(e + f*x)/f, Ne(f, 0)), (x*(a + b*tan(e
)**2)**2*tan(e)**2, True))

________________________________________________________________________________________